import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

import { getTemplate } from '@/utils/function.js'

let template = getTemplate()

export default new Router({
    routes: [
        {
            path: '/',
            name: 'home',
            component: function (resolve) {
                require([`@/modules/home/${template}/app.vue`], resolve)
            }
        },
        {
            path: '/search',
            name: 'Search',
            component: function (resolve) {
                require([`@/modules/search/${template}/app.vue`], resolve)
            }
        },
        {
            path: '/list',
            component: function (resolve) {
                require([`@/modules/list/${template}/app.vue`], resolve)
            }
        },
        {
            path: '/goods/:goodsSn',
            name: 'Goods',
            component: function (resolve) {
                require([`@/modules/goods/${template}/app.vue`], resolve)
            }
        },
        {
            path: '/category',
            name: 'category',
            component: function (resolve) {
                require([`@/modules/category/${template}/app.vue`], resolve)
            }
        },
        {
            path: '/categorySearch/:cid',            
            component: function (resolve) {
                require([`@/modules/list/${template}/app.vue`], resolve)
            }
        }            
    ]
})
